package Java攻略._3_流式操作._3_利用reduce方法实现归约操作;

import java.util.stream.Stream;

public class _24_利用StringBuilder收集字符串 {

    public static void main(String[] args) {

        String s = Stream.of("this", "is", "a", "list")
                .collect(() -> new StringBuilder(),
                        (sb, str) -> sb.append(str),
                        (sb1, sb2) -> sb1.append(sb2)
                )
                .toString();

        System.out.println(s);
    }
}
